package com.leyou.common.utils;

import com.leyou.common.auth.entity.UserInfo;

/**
 * @author xiuer
 * @description token中的用户信息
 * @create 2019/7/12 11:47
 */
public class UserHolder {


    private static ThreadLocal<UserInfo> TL = new ThreadLocal<>();


    public static void setUser(UserInfo userInfo) {
        TL.set(userInfo);
    }

    public static UserInfo getUserInfo() {
        return TL.get();
    }
    /*释放线程*/
    public static void remove() {
        TL.remove();
    }

}
